﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BaMusaSoft.RPS.ViewModel.Infrastructure;
using BaMusaSoft.RPS.ViewModel.Properties;

namespace BaMusaSoft.RPS.ViewModel
{
    public class DataGridColumnsViewModel:Workspace
    {
        Settings settings;
        public DataGridColumnsViewModel()
        {
            settings = Settings.Default;
        }
        public bool? ShowScheduleId
        {
            get { return settings.DataGrid_ShowScheduleId; }
            set
            {
                if (value != settings.DataGrid_ShowScheduleId)
                {
                    settings.DataGrid_ShowScheduleId = (bool) value;
                    RaisePropertyChanged("ShowScheduleId");
                }
            }
        }
        public bool? ShowRegistredAt
        {
            get { return settings.DataGrid_ShowRegistredAt; }
            set
            {
                if (value != settings.DataGrid_ShowRegistredAt)
                {
                    settings.DataGrid_ShowRegistredAt = (bool)value;
                    RaisePropertyChanged("ShowRegistredAt");
                }
            }
        }
        public bool? ShowContractNo
        {
            get { return settings.DataGrid_ShowContractNo; }
            set
            {
                if (value != settings.DataGrid_ShowContractNo)
                {
                    settings.DataGrid_ShowContractNo =(bool) value;
                    RaisePropertyChanged("ShowContractNo");

                }
            }
        }

        public bool? ShowCustomerId
        {
            get { return settings.DataGrid_ShowCustomerId; }
            set
            {
                if (value != settings.DataGrid_ShowCustomerId)
                {
                    settings.DataGrid_ShowCustomerId = (bool)value;
                    RaisePropertyChanged("ShowCustomerId");

                }
            }
        }
        public bool? ShowCustomerName
        {
            get { return settings.DataGrid_ShowCustomerName; }
            set
            {
                if (value != settings.DataGrid_ShowCustomerName)
                {
                    settings.DataGrid_ShowCustomerName = (bool)value;
                    RaisePropertyChanged("ShowCustomerName");
                }
            }
        }
        public bool? ShowPropertyNo
        {
            get { return settings.DataGrid_ShowPropertyNo; }
            set
            {
                if (value != settings.DataGrid_ShowPropertyNo)
                {
                    settings.DataGrid_ShowPropertyNo = (bool)value;
                    RaisePropertyChanged("ShowPropertyNo");

                }
            }
        }
        public bool? ShowPropertyDescription
        {
            get { return settings.DataGrid_ShowPropertyDescription; }
            set
            {
                if (value != settings.DataGrid_ShowPropertyDescription)
                {
                    settings.DataGrid_ShowPropertyDescription = (bool)value;
                    RaisePropertyChanged("ShowPropertyDescription");

                }
            }
        }
        public bool? ShowAmountDue
        {
            get { return settings.DataGrid_ShowAmoutDue; }
            set
            {
                if (value != settings.DataGrid_ShowAmoutDue)
                {
                    settings.DataGrid_ShowAmoutDue = (bool)value;
                    RaisePropertyChanged("ShowAmountDue");

                }
            }
        }
        public bool? ShowDateDue
        {
            get { return settings.DataGrid_ShowDateDue; }
            set
            {
                if (value != settings.DataGrid_ShowDateDue)
                {
                    settings.DataGrid_ShowDateDue = (bool)value;
                    RaisePropertyChanged("ShowDateDue");

                }
            }
        }
        public bool? ShowAmountPaid
        {
            get { return settings.DataGrid_ShowAmountPaid; }
            set
            {
                if (value != settings.DataGrid_ShowAmountPaid)
                {
                    settings.DataGrid_ShowAmountPaid = (bool)value;
                    RaisePropertyChanged("ShowAmountPaid");

                }
            }
        }
        public bool? ShowBalance
        {
            get { return settings.DataGrid_ShowBalance ; }
            set
            {
                if (value != settings.DataGrid_ShowBalance)
                {
                    settings.DataGrid_ShowBalance = (bool)value;
                    RaisePropertyChanged("ShowBalance");

                }
            }
        }
        public bool? ShowSignerName
        {
            get { return settings.DataGrid_ShowSignerName; }
            set
            {
                if (value != settings.DataGrid_ShowSignerName)
                {
                    settings.DataGrid_ShowSignerName = (bool)value;
                    RaisePropertyChanged("ShowSignerName");
                }
            }
        }
        public bool? ShowMobile
        {
            get { return settings.DataGrid_ShowSignerMobile; }
            set
            {
                if (value != settings.DataGrid_ShowSignerMobile)
                {
                    settings.DataGrid_ShowSignerMobile = (bool)value;
                    RaisePropertyChanged("ShowMobile");

                }
            }
        }
        public bool? ShowPhone
        {
            get { return settings.DataGrid_ShowSignerPhone; }
            set
            {
                if (value != settings.DataGrid_ShowSignerPhone)
                {
                    settings.DataGrid_ShowSignerPhone = (bool)value;
                    RaisePropertyChanged("ShowPhone");

                }
            }
        }
        public bool? ShowHadPaid
        {
            get { return settings.DataGrid_ShowHadPaid; }
            set
            {
                if (value != settings.DataGrid_ShowHadPaid)
                {
                    settings.DataGrid_ShowHadPaid = (bool)value;
                    RaisePropertyChanged("ShowHadPaid");

                }
            }
        }


        public void Save()
        {
            settings.Save();
        }

        #region Overrides of Workspace

        public override string DisplayName
        {
            get { throw new NotImplementedException(); }
            protected set { throw new NotImplementedException(); }
        }

        public override bool HasChanges
        {
            get { throw new NotImplementedException(); }
        }

        #endregion
    }
}
